<!-- Oemsaas front_variable Start -->
<script type="text/javascript">

    // 指定界面  变量预埋
    var oemcart_data_id = 0;

    {% if template == 'product_detail' or template == 'product_quick_detail' %}
    var oemcart_product_id = {{ product.id }};
    var oemcart_product = {{ product | json }};
    var oemcart_product_category_breadcrumbs = {{ product.collections | json }};
    var oemcart_data_id = {{ product.id }};
    {% endif %}

    {% if template == 'collection_detail' %}
    var oemcart_collection = {{ collection | json }};
    var oemcart_data_id = {{ collection.id | default: 0 }};
    {% endif %}


    {% if template == 'blog_detail' %}
    var oemcart_blog = {{ blog | json }};
    var oemcart_data_id = {{ blog.id }};
    {% endif %}


    {% if template == 'page_detail' %}
    var oemcart_page = {{ page | json }};
    var oemcart_data_id = {{ page.id }};
    {% endif %}

    {% if template == 'order_success' %}
    var oemcart_order = {{ order | json }}
    var oemcart_order_items = {{ order.products | json }}
    {% endif %}

    {% if template == 'order_contact_information' %}
    var oemcart_order_items = {{ cart.items | json }}
    {% endif %}

    {% if template == 'order_shipping_method' %}
    var oemcart_order = {{ order | json }}
    var oemcart_order_items = {{ cart.items | json }}
    {% endif %}

    {% if template == 'order_payment_method' %}
    var oemcart_order = {{ order | json }}
    var oemcart_order_items = {{ cart.items | json }}
    {% endif %}




    // 基础变量
    var oemcart_current_template = '{{ template }}';
    var oemcart_store_id = {{ storeInfo.id }};
    var oemcart_user_id = {{ customerId }};
    var oemcart_time_zone = '{{ storeInfo.time_zone }}';
    var oemcart_page_ca = '{{ page_ca }}';
    var oemcart_user_email = '{{ customerInfo.email }}';

    var oemcart_data_from = '{{ data_from }}';

    //当前货币
    var oemcart_currency = {{ currency | json }};
    var oemcart_currency_code = '{{ currency.standard_code }}';
    var oemcart_currency_rate = '{{ currency.currency_rate }}';
    var oemcart_currency_lcoin = '{{ currency.currency_lcoin }}';
    var oemcart_currency_rcoin = '{{ currency.currency_rcoin }}';
    var oemcart_currency_decimal = '{{ currency.currency_decimal }}';


    //主货币
    var oemcart_base_currency = {{ base_currency | json }};
    var oemcart_base_currency_code = '{{ base_currency.standard_code }}';
    var oemcart_base_currency_rate = '{{ base_currency.currency_rate }}';
    var oemcart_base_currency_lcoin = '{{ base_currency.currency_lcoin }}';
    var oemcart_base_currency_rcoin = '{{ base_currency.currency_rcoin }}';
    var oemcart_base_currency_decimal = '{{ base_currency.currency_decimal }}';

    var oemcart_website_domain = '{{ current_domain }}';
    var oemcart_real_domain = '{{ current_domain }}';

    var oemcart_site_type = '{{ sourceDevice }}';
    var oemcart_client_country = '{{ country }}';

    var oemcart_protocal_type = '{{ request_info.REQUEST_SCHEME }}';
    var oemcart_website_language = '{{ langName }}';


    var oemcart_utm_source = '{{ utm_source }}';
    var oemcart_utm_medium = '{{ utm_medium }}';
    var oemcart_utm_term = '{{ utm_term }}';
    var oemcart_utm_campaign = '{{ utm_campaign }}';
    var oemcart_utm_content = '{{ utm_content }}';

    var oemcart_global_unique_id = '{{ visit_id }}';
    var oemcart_global_session_unique_id = '{{ session_visit_id }}';
    var oemcart_countrys = {{ countries_dictionary | json }};


    //当前host
    var current_domain = '{{ current_domain }}';


    //存储装修信息
    var themeConfig = {{ theme_config | json}};

    //当前路由
    var oemcart_current_router = '{{ routes.current_route }}';

    var storeConfig = {{ storeConfig | json}};
    var lang = {{ lang | json }};

</script>
<!-- Oemsaas front_variable End -->
